package com.itheima.javabenan;

public class Student {
    //1.私有成员变量。
    private String name;
    private char sex;
    private int age; static {
            System.out.println("静态代码块执行了");
        }

    //2.提供公共的无参数构造器

    public Student() {//无参构造器
    }

    public Student(String name, char sex, int age) {//有参构造器
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
